<script setup lang="ts">
defineProps({
  hospital: {
    type: Object,
    default: () => ({})
  }
})
</script>

<template>
  <el-card shadow="hover" :title="hospital?.hosname" @click="$router.push({name: 'hospital', query: {hoscode: hospital.hoscode}})">
    <template #header>
      <span class="hospital-name">{{ hospital?.hosname }}</span>
    </template>
    <div class="left">
      <div class="title">
        <span class="hospital-info">{{ hospital?.intro }}</span>
      </div>
      <div class="bottom">
        <span> <i class="iconfont icon-paiming"></i> {{ hospital?.param?.hostypeString }}</span>
        <span> <i class="iconfont icon-shizhong"></i> 每天{{ hospital?.bookingRule?.releaseTime }}放号 </span>
      </div>
    </div>
    <div class="right">
      <el-avatar :size="80" :src="`data:image/jpeg;base64,${hospital?.logoData}`">
        <img src="@/assets/images/logo.png"/>
      </el-avatar>
    </div>
  </el-card>
</template>

<style scoped lang="scss">
.el-card {
  width: 48%;
  margin-bottom: 20px;
  cursor: pointer;

  .el-card__header {
    .hospital-name {
      font-weight: 800;
      font-size: 16px;
    }

  }

  :deep( .el-card__body) {
    display: flex;
    justify-content: space-between;

    .left {
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      flex: .8;

      .title {
        width: 100%;
        display: flex;
        flex-direction: column;
        font-size: 16px;


        .hospital-info {
          width: 280px;
          display: block;
          color: #999999;
          font-size: 14px;
          text-overflow: ellipsis;
          overflow: hidden;
          word-break: break-all;
          white-space: nowrap;
        }
      }

      .bottom {
        display: flex;
        justify-content: space-between;
        color: #999999;
        font-size: 14px;
      }
    }

    .right {
      width: 80px;
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;

      .el-avatar {
        background-color: #ffffff;
      }
    }

  }

}
</style>
